home *** CD-ROM | disk | FTP | other *** search
- // PrintLabels.h - autogenerated from PrintLabels.arg on Sat Apr 23 15:19:23 1994
- // Do not edit this file! Re-run makeargprc to re-generate
-
- #ifndef VERSION
- #define VERSION "V0.0"
- #endif
-
- class PrintLabels {
- public:
- PrintLabels(int argc,char** argv);
- void Usage();
- char* infile; // The name of the file to print records from
- Boolean infile_passed;
- char* templatefile; // The name of the template file
- Boolean templatefile_passed;
- char* by; // Should be one of {Id, Title, Author, Subject} - selects card type.
- Boolean by_passed;
- char* only; // selection expression
- Boolean only_passed;
- };
-
- void PrintLabels::Usage()
- {
- cout << "Syntax: PrintLabels [opts]\n";
- cout << "Libraian Card Catalog card printer\n";
- cout << "This program is used to print out cards\n";
- cout << "Prints either large (5x8) or small cards (3x5)\n";
- cout << "Prints \"Shelf List\" (by=Id), Title reference (by=Title),\n";
- cout << "Author reference (by=Author), or Subject reference\n";
- cout << "(by=Subject). By default a \"Shelf List\" is printed.\n";
- cout << "Options:\n";
- cout << "-infile\tString Required The name of the file to print records from\n";
- cout << "-templatefile\tString Required The name of the template file\n";
- cout << "-by\tString Optional Should be one of {Id, Title, Author, Subject} - selects card type.\n";
- cout << "-only\tString Optional selection expression \n";
- cout << "\n\tVersion: " << VERSION << "\n"; cout << "\tCopyright (c) 1991,1992 Robert Heller D/B/A Deepwoods Software\n";}
-
- PrintLabels::PrintLabels(int argc,char** argv)
- {
- infile_passed = false;
- templatefile_passed = false;
- by_passed = false;
- only_passed = false;
- for (int iarg=1;iarg<argc;iarg++) {
- if (strcmp(argv[iarg],"-?") == 0 ||
- strcmp(argv[iarg],"-U") == 0) {
- Usage(); exit(0);
- } else if (strcmp(argv[iarg],"-infile") == 0 && (iarg+1) < argc) {
- iarg++;
- infile_passed = true;
- infile = argv[iarg];
- } else if (strcmp(argv[iarg],"-templatefile") == 0 && (iarg+1) < argc) {
- iarg++;
- templatefile_passed = true;
- templatefile = argv[iarg];
- } else if (strcmp(argv[iarg],"-by") == 0 && (iarg+1) < argc) {
- iarg++;
- by_passed = true;
- by = argv[iarg];
- } else if (strcmp(argv[iarg],"-only") == 0 && (iarg+1) < argc) {
- iarg++;
- only_passed = true;
- only = argv[iarg];
- } else {
- cerr << "Bad option: " << argv[iarg] << "\n";
- Usage(); exit(1);
- }
- }
- if (!infile_passed) {
- cerr << "Missing parameter: infile\n";
- Usage(); exit(1);
- }
- if (!templatefile_passed) {
- cerr << "Missing parameter: templatefile\n";
- Usage(); exit(1);
- }
- }
-